package com.atos.asde2.tcpme.tcpserver.serverthread;

import com.atos.utils.common.StringHelper;

public class MainTest {

	public static String trim(String args,char beTrim) {
		int st = 0;
		int len = args.length();
		char[] val = args.toCharArray();
		char sbeTrim = beTrim;
		while ((st < len) && (val[st] <= sbeTrim)) {
			st++;
		}
		while ((st < len) && (val[len - 1] <= sbeTrim)) {
			len--;
		}
		return ((st > 0) || (len < args.length())) ? args.substring(st, len) : args;
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		//System.out.println(trim(",1231,,,123,",','));
		System.out.println(StringHelper.trimWith(",",",1231,,,123,"));
		
	}

}
